<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>权限管理</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/front/css/bootstrap.min.css"/>
</head>
<body>
<%@include file="/inc/menu.jsp"%>
<div class="container-fluid">
    <div class="main-content">
        <div class="row">
            <div class="col-sm-12">
                <ul class="nav nav-tabs nav-3rd">
                    <li><span>权限管理</span></li>
                    <li class="active">权限列表</li>
                    <li><a href="${pageContext.request.contextPath}/admin/permission/edit">新增权限</a></li>
                </ul>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/admin/permission/edit">新增</a>
                <a class="btn btn-primary" href="#">删除</a>
            </div>
            <%--<div class="col-sm-5 col-sm-offset-1">--%>
            <%--<form id="searchForm" method="post" action="${pageContext.request.contextPath}/admin/permission/list" name="permission"--%>
            <%--htmlEscape="false">--%>
            <%--#set($pageNo = $pager.number + 1)--%>
            <%--#set($size = $pager.size)--%>
            <%--<input id="pageNo" name="pageNo" type="hidden" value="$pageNo"/>--%>
            <%--<input id="pageSize" name="pageSize" type="hidden" value="$size"/>--%>

            <%--<div class="input-group">--%>
            <%--<span class="input-group-addon">权限：</span>--%>
            <%--<input name="name" type="text" class="form-control" placeholder="请输入你要查询的权限" value="$!search"--%>
            <%--onkeypress="var e=window.event||this;var c=e.keyCode||e.which;if(c==13)page(1,$pager.size);" >--%>
            <%--<span class="input-group-btn">--%>
            <%--<button class="btn btn-default" onclick="page(1,$pager.size)" type="submit">查询</button>--%>
            <%--</span>--%>
            <%--</div>--%>
            <%--</form>--%>
            <%--</div>--%>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div>
                    <table class="table table-bordered table-striped table-condensed table-hover">
                        <thead>
                        <tr>
                            <th>
                                <button id="check-all" class="btn btn-sm btn-default">全选</button>
                                <button id="check-cancel" class="btn btn-sm btn-default hidden">取消</button>
                            </th>
                            <th>中文名</th>
                            <th>权限键值</th>
                            <th>创建日期</th>
                            <th>最后修改</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${rootResourceDto.subResourceDto}" var="resource1Dto">
                            <tr>
                                <td><input id="" class="checkable" name="dele-permission-id" type="checkbox" value="">
                                </td>
                                <td>${resource1Dto.resource.cnName}</td>
                                <td>${resource1Dto.resource.name}</td>
                                <%--不实现删除非资源权限对--%>
                            </tr>
                            <c:forEach items="${resource1Dto.subResourceDto}" var="resource2Dto">
                                <tr>
                                    <td><input id="" class="checkable" name="dele-permission-id" type="checkbox" value="">
                                    </td>
                                    <td>${resource2Dto.resource.cnName}</td>
                                    <td>${resource2Dto.resource.name}</td>
                                        <%--不实现删除非资源权限对--%>
                                </tr>
                                <c:forEach items="${resource2Dto.resource.resourcePermissionList}" var="resoPerm">
                                    <tr>
                                        <td><input id="" class="checkable" name="dele-permission-id" type="checkbox" value="">
                                        </td>
                                        <td>${resoPerm.cnName}</td>
                                        <td>${resoPerm.resoPermString}</td>
                                        <td>${resoPerm.createDate}</td>
                                        <td>${resoPerm.updateDate}</td>
                                        <td>
                                            <a class="btn btn-default"
                                               href="${pageContext.request.contextPath}/admin/permission/edit?id=${resoPerm.id}">修改</a>
                                            <a class="btn btn-default" href="#" onclick="if (confirm('确认要删除该权限吗？此操作将不可恢复！'))
                                                    location = '${pageContext.request.contextPath}/admin/permission/delete/${resoPerm.id}';
                                                    return false;">删除</a>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:forEach>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

    </div>
</div>
</body>
</html>
